import { serviceExe } from './axios.js';

export function login(params) {
  let _url = 'security/auth/login';
  return serviceExe({
    url: _url,
    method: 'post',
    data: params,
  });
}

// 查询资产接⼝  wjh
export function getProperty(pageSize, pageNum) {
  return serviceExe({
    url: `/manage-assets/assets?pageSize=${pageSize}&pageNum=${pageNum}`,
    method: 'get',
    // data: params,
  });
}

// 添加资产接⼝  wjh
export function addProperty(params) {
  return serviceExe({
    url: `/manage-assets/assets`,
    method: 'post',
    data: params,
  });
}

// 删除资产接⼝  wjh
// export function delProperty(id) {
//   return serviceExe({
//     url: `/manage-assets/assets?assets=${id}`,
//     method: 'delete',
//   });
// }

// 删除资产接⼝  wjh
export function delProperty(ids) {
  return serviceExe({
    url: `/manage-assets/assets?ids=${ids}`,
    method: 'delete',
  });
}

// 导出资产接⼝  wjh
export function exportProperty() {
  return serviceExe({
    url: `/manage-assets/assets/export`,
    method: 'get',
    responseType: 'blob',
  });
}

// 导入资产接⼝  wjh
export function importProperty(params) {
  return serviceExe({
    url: `/manage-assets/assets/import`,
    method: 'post',
    data: params,
  });
}

// 查询具体资产信息  wjh
export function refeProperty() {
  return serviceExe({
    url: `/manage-assets/assets/qurryById`,
    method: 'get',
  });
}

// 空间资产添加id  wjh
export function spaceProperty(params) {
  return serviceExe({
    url: `/manage-assets/assets/space`,
    method: 'post',
    data: params,
  });
}

// 3D视图添加资产  wjh
export function byProperty(params) {
  return serviceExe({
    url: `/manage-assets/assets/threeD`,
    method: 'post',
    data: params,
  });
}

// 查询空间id关联的资产  wjh
export function spaProperty(spaceId, cadTreeId) {
  return serviceExe({
    url: `/manage-assets/assets/bySpaceId?spaceId=${spaceId}&cadTreeId=${cadTreeId}`,
    method: 'get',
  });
}

// 查询3D模型关联的资产  wjh
export function cadProperty(modelName, cadTreeId) {
  return serviceExe({
    url: `/manage-assets/assets/byModelName?modelName=${modelName}&cadTreeId=${cadTreeId}`,
    method: 'get',
  });
}